package com.xingshentech.ugv.operate.module.httpdata;

import com.xingshentech.ugv.operate.module.auth.AuthTokenVO;
import com.xingshentech.ugv.operate.module.auth.User;
import com.xingshentech.ugv.operate.module.bean.BaseResponseMap;
import com.xingshentech.ugv.operate.module.bean.MapBean;
import com.xingshentech.ugv.operate.module.bean.RuleBean;
import com.xingshentech.ugv.operate.module.bean.SiteBean;
import com.xingshentech.ugv.operate.module.bean.StationStatus;
import com.xingshentech.ugv.operate.module.bean.VehicleBean;
import com.xstech.library.rxjavahttp.ApiAddress;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.PATCH;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface MapApi {

    /**
     * 登录
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @POST(ApiAddress.userLogin)
    Observable<BaseResponseMap<Object>> userLogin(@Body Map<String,String> params);

    /**
     * 添加站点
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @POST(ApiAddress.addSite)
    Observable<BaseResponseMap<Object>> addSite(@Body Map<String,String> params);

    /**
     * 添加站点
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @POST(ApiAddress.addCarInfo)
    Observable<BaseResponseMap<Object>> addCarInfo(@Body Map<String,String> params);

    /**
     * 获取站点列表
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @GET(ApiAddress.getSiteList)
    Observable<BaseResponseMap<List<SiteBean>>> getSiteList();

    /**
     * 获取用户信息
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @GET(ApiAddress.userInfo)
    Observable<BaseResponseMap<User>> userInfo();

    /**
     * 获取权限
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @GET(ApiAddress.getUserRule)
    Observable<BaseResponseMap<List<RuleBean>>> getRule();

    /**
     * 刷新token
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @POST(ApiAddress.reflashToken)
    Observable<BaseResponseMap<AuthTokenVO>> reflashToken(@Body AuthTokenVO token);

    /**
     * 获取用户站点列表
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @GET(ApiAddress.getUserSite)
    Observable<BaseResponseMap<List<StationStatus>>> getUserSite();

    /**
     * 获取当前站点下的车辆
     */

    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @GET(ApiAddress.getVehicle)
    Observable<BaseResponseMap<List<VehicleBean>>> getVehicle(@Query("siteId") String id);

    /**
     * 获取当前车辆的地图
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @GET(ApiAddress.getMapList)
    Observable<BaseResponseMap<List<MapBean>>> getMapList(@Query("siteId") String id, @Query("carId") String carId);

    /**
     * 分享地图
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @POST(ApiAddress.mapShare)
    Observable<BaseResponseMap<Object>> addShareMap(@Body Map<String,String> params);

    /**
     * 修改用户信息
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @PATCH(ApiAddress.updateUserInfo)
    Observable<BaseResponseMap<Object>> updateUserInfo(@Body User user);

    /**
     * 修改用户信息
     */
    @Headers({"Content-Type: application/json","Accept: application/json","urlName:map"})
    @GET(ApiAddress.checkLogin)
    Observable<BaseResponseMap<Object>> checkLogin();
}
